/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bc;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author DEAPP
 */
@Entity
@Table(name = "detalle_matricula_alumno")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DetalleMatriculaAlumno.findAll", query = "SELECT d FROM DetalleMatriculaAlumno d"),
    @NamedQuery(name = "DetalleMatriculaAlumno.findByIdDetalleMatriculaAlumno", query = "SELECT d FROM DetalleMatriculaAlumno d WHERE d.idDetalleMatriculaAlumno = :idDetalleMatriculaAlumno"),
    @NamedQuery(name = "DetalleMatriculaAlumno.findByEstadoExistencia", query = "SELECT d FROM DetalleMatriculaAlumno d WHERE d.estadoExistencia = :estadoExistencia")})
public class DetalleMatriculaAlumno implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_detalle_matricula_alumno")
    private Integer idDetalleMatriculaAlumno;
    @Column(name = "estadoExistencia")
    private Integer estadoExistencia;
    @JoinColumn(name = "id_alumno", referencedColumnName = "id_alumno")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Alumno alumno;
    @JoinColumn(name = "id_matricula", referencedColumnName = "id_matricula")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Matricula matricula;

    public DetalleMatriculaAlumno() {
    }

    public DetalleMatriculaAlumno(Integer idDetalleMatriculaAlumno) {
        this.idDetalleMatriculaAlumno = idDetalleMatriculaAlumno;
    }

    public Integer getIdDetalleMatriculaAlumno() {
        return idDetalleMatriculaAlumno;
    }

    public void setIdDetalleMatriculaAlumno(Integer idDetalleMatriculaAlumno) {
        this.idDetalleMatriculaAlumno = idDetalleMatriculaAlumno;
    }

    public Integer getEstadoExistencia() {
        return estadoExistencia;
    }

    public void setEstadoExistencia(Integer estadoExistencia) {
        this.estadoExistencia = estadoExistencia;
    }

    public Alumno getAlumno() {
        return alumno;
    }

    public void setAlumno(Alumno alumno) {
        this.alumno = alumno;
    }

    public Matricula getMatricula() {
        return matricula;
    }

    public void setMatricula(Matricula matricula) {
        this.matricula = matricula;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDetalleMatriculaAlumno != null ? idDetalleMatriculaAlumno.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DetalleMatriculaAlumno)) {
            return false;
        }
        DetalleMatriculaAlumno other = (DetalleMatriculaAlumno) object;
        if ((this.idDetalleMatriculaAlumno == null && other.idDetalleMatriculaAlumno != null) || (this.idDetalleMatriculaAlumno != null && !this.idDetalleMatriculaAlumno.equals(other.idDetalleMatriculaAlumno))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bc.DetalleMatriculaAlumno[ idDetalleMatriculaAlumno=" + idDetalleMatriculaAlumno + " ]";
    }
    
}
